package online.sanen.mhdt.entity.equip;

import online.sanen.mhdt.RandomeTool;
import online.sanen.mhdt.entity.AttrPoint;
import online.sanen.mhdt.entity.attr.Attribute;

import java.util.List;

public abstract class Equip {
    /**
     * 装备等级
     */
    protected int level;
    /**
     * 装备名
     */
    protected String name;
    /**
     * 描述
     */
    protected String desc;
    /**
     * 当前耐久
     */
    protected int endCurrent;
    /**
     * 耐久上限
     */
    protected int end;
    /**
     * 装备是否已鉴定
     */
    protected boolean isAuth;
    /**
     * 装备额外属性
     */
    protected List<Attribute> attrList;

    protected abstract void initBaseAttr();

    /**
     * 装备鉴定
     */
    public void auth() {
        isAuth = true;
        attrList = RandomeTool.getAttrs(level);
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getEndCurrent() {
        return endCurrent;
    }

    public void setEndCurrent(int endCurrent) {
        this.endCurrent = endCurrent;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }

    public boolean isAuth() {
        return isAuth;
    }

    public void setAuth(boolean auth) {
        isAuth = auth;
    }

    public List<Attribute> getAttrList() {
        return attrList;
    }

    public void setAttrList(List<Attribute> attrList) {
        this.attrList = attrList;
    }

    @Override
    public String toString() {
        return "Equip{" +
                "attrList=" + attrList +
                '}';
    }
}
